/**
 * @file httpsvr_demo.cpp
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2024-07-20
 * 
 * @copyright Copyright (c) 2024
 * 
 */

#include "httpSvr/httpServer.h"
#include "httpSvr/router.h"
#include "httpSvr/request.h"
#include "httpSvr/response.h"

using namespace wheels;
using namespace std;

void test_hander(Request &req, Response &res)
{
    printf("test_hander\n");
}

std::shared_ptr<IRouter> init_router(void)
{
    auto r = CreateRouter();
    r->Register("/", HttpMethod::GET, test_hander);
    return r;
}

int main()
{
    auto r = init_router();
    HttpServer server(r);
    server.Start("0.0.0.0", 8816);

    sleep(300);
    printf("wall exit !!!\n");
    server.Stop();
    printf("stop ok !!!\n");
    return 0;
}
 
